# Maintainer: Alexey Pavlov <alexpux@gmail.com>

pkgname=psmisc
pkgver=22.21
pkgrel=1
pkgdesc="Miscellaneous procfs tools"
arch=('i686' 'x86_64')
url="http://psmisc.sourceforge.net/"
license=('GPL')
groups=('sys-utils')
depends=('msys2-runtime' 'gcc-libs' 'ncurses' 'libiconv' 'libintl')
makedepends=('gcc' 'ncurses-devel' 'libiconv-devel' 'gettext-devel')
source=(http://downloads.sourceforge.net/psmisc/${pkgname}-${pkgver}.tar.gz
        'psmisc-fuser.patch')
sha1sums=('09fabbef4539b58b6b8738a73da3d21d5daa1a58'
          'e739ad5b14ca836db5859f0755d8f2fc8e86de69')

prepare() {
  cd ${pkgname}-${pkgver}
  patch -p1 -i ${srcdir}/psmisc-fuser.patch
  autoreconf -fi
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure \
    --prefix=/usr \
    --without-libiconv-prefix \
    --without-libintl-prefix \
    CPPFLAGS="${CPPFLAGS} -I/usr/include/ncursesw"
  make
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
